var a = getApp();

Page({
    data: {
        language: "",
        page: 1
    },
    onLoad: function(a) {
        this.getData();
    },
    onReady: function() {
        var a = wx.getStorageSync("langIndex");
        this.setData({
            language: a.en
        });
    },
    onShow: function() {},
    onHide: function() {},
    onUnload: function() {},
    onPullDownRefresh: function() {},
    onReachBottom: function() {
        if (console.log(this.data.current_page, this.data.last_page), this.data.current_page >= this.data.last_page) wx.showToast({
            title: "没有更多",
            icon: "none",
            duration: 1e3
        }); else {
            var a = this.data.page + 1;
            this.setData({
                page: a
            }), this.getMore();
        }
    },
    onShareAppMessage: function() {},
    toNoticeInfo: function(a) {
        console.log(a.currentTarget.dataset.isda.id), wx.navigateTo({
            url: "/packageA/member/article/articleContent/articleContent?article_id=" + a.currentTarget.dataset.isda.id
        });
    },
    getData: function() {
        var t = this, e = a.getNetAddresss("plugin.article-pay.api.index.articlePayData");
        a._getNetWork({
            url: e,
            data: {
                page: t.data.page,
                art: "payed"
            },
            success: function(a) {
                var e = a.data;
                console.log(e), 1 == e.result && t.setData({
                    datas: e.data.getPayed.articles.data,
                    current_page: e.data.getPayed.articles.current_page,
                    last_page: e.data.getPayed.articles.last_page
                });
            },
            fail: function(a) {
                console.log(a);
            }
        });
    },
    getMore: function() {
        var t = this, e = a.getNetAddresss("plugin.article-pay.api.index.articlePayData");
        a._getNetWork({
            url: e,
            data: {
                page: t.data.page,
                art: "payed"
            },
            success: function(a) {
                var e = a.data;
                console.log(e), 1 == e.result && t.setData({
                    datas: t.data.datas.concat(e.data.getPayed.articles.data),
                    current_page: e.data.getPayed.articles.current_page,
                    last_page: e.data.getPayed.articles.last_page
                });
            },
            fail: function(a) {
                console.log(a);
            }
        });
    }
});